
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>个人简历中心</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/bootstrap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/bootstrap-theme.css">
    <script src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/personalCenter.css"/>
</head>
<script>

    function iframe(){
        var sms = "";//接收session中的信息
        var perName = $("#perName").val();
        console.log(perName);
        $.ajax({
            url: "${pageContext.request.contextPath}/login/index",
            type: "post",
            data:{   //数据传输到服务器
            },
            dataType:"json",
            success:function (result) {
                sms = result.data;
                if(sms != null){
                    perName = sms.perName;
                    //渲染登录名
                    $(".dropbtn").children(":first").children(":last-child").hide();
                    var perName1 = $(".dropbtn").append($(".dropbtn").children(":first").children(":first").text(perName));
                }else {
                    $(".dropdown").children(":last-child").hide();
                    $(".dropdown").children(":first").children(":first").children("img").hide();
                }
            }
        });
        //轮播样式
        layui.use('carousel', function(){
            var carousel = layui.carousel;
            //建造实例
            carousel.set({
                elem: '#test3'
                ,width: '100%' //设置容器宽度

                ,height: '187px' //设置容器高度
                ,arrow: 'hover' //始终显示箭头
                ,anim: 'fade' //切换动画方式
                ,autoplay:false//是否自动切换
                ,interval:3000//自动切换时间
                ,indicator:'none' //指示器隐藏
            });
        });

        $.ajax({

            url:"${pageContext.request.contextPath}/resumeCenter/rendering",
            type:"post",
            data:{
            },
            dataType:"json",
            success:function (result2) {
                var temp = result2.data;
                // var temp2 = $(".resumesChange");
                var resumeName = ""; //简历名
                var readStatus = "";//简历公开状态
                var resumesId = "";//简历id
                var resumesTime = "";//简历更新时间
                var resumesStatus = "";//简历状态（0：代表已经删除，1：代表没有删除）
                console.log(temp);//输出查询到的简历集合
                var resumesCreateTime = "";//简历创建时间
                var resumePerName = "";//简历中用户姓名
                var resumePerGender = "";//用户的性别数字
                var resumePerBirth = "";//用户的出生日期
                var resumePerAddress = "";//用户的住址
                var gender = "";//性别
                //日期
                function date2String(date){
                    date = new Date(date);
                    var y=date.getFullYear();
                    var m=date.getMonth()+1;
                    var d=date.getDate();
                    var h=date.getHours();
                    var m1=date.getMinutes();
                    var s=date.getSeconds();
                    m = m<10?("0"+m):m;
                    d = d<10?("0"+d):d;
                    return y+"-"+m+"-"+d+"-"+h+"-"+m1+"-"+s;
                }
                //===================动态渲染简历信息
                for(var i = 0; i < temp.length;i++){

                    resumeName = temp[i].resumeName;//从Session中获得简历名
                    console.log("session中的简历名"+resumeName);
                    readStatus = temp[i].readStatus;//从Session中获得简历状态
                    console.log("session中的简历公开程度"+readStatus);
                    resumesId = temp[i].resumeId;//从Session中获得简历Id
                    console.log("session中的简历ID"+resumesId);
                    resumesTime = temp[i].resumeUpdatetime;//从Session中获得简历更新时间
                    console.log("session中的简历上传时间"+resumesTime);
                    resumesStatus = temp[i].resumesStatus;//从Session中获得简历删除状态
                    console.log("session中的简历状态"+resumesStatus);
                    resumesCreateTime = temp[i].resumeCreatetime;//从Session中获得简历创建时间
                    resumePerName = sms.perName;//用户的名字
                    resumePerGender = sms.perAddress;//用户的性别
                    resumePerBirth = sms.perBirth;//用户的出生日期
                    // resumeWorkTime = sms.;//用户的工作经验
                    resumePerAddress = sms.perAddress; //用户的地址
                    //拼接编辑按钮跳转的Url
                    var resumesUrl = "${pageContext.request.contextPath}/resume/in/?resumesId="+resumesId;
                    //===================控制layui轮播的简历数

                    // =========================根据简历状态动态渲染简历
                    // if( resumesStatus == 1) {
                    //     $(".resumesJump").append(el);
                    // }else{
                    //     console.log("被删除的"+resumesId)
                    // }

                    //=========================把简历的名字动态的渲染到页面中
                    var resumeNameText = ($(".resumesJump").children('div').eq(i).children(":last-child").children('div').eq(0).children('div').eq(0).children(":first").text(resumeName));
                    console.log("获得页面中的简历名字"+resumeNameText);

                    //=========================把编辑的超链接动态的渲染到页面中
                    var resumeUrlText = ($(".resumesJump").children('div').eq(i).children('div').eq(1).children('div').eq(1).children(":last-child").attr('href',resumesUrl));
                    console.log("页面中的编辑"+resumeUrl);
                    //=========================渲染简历数据
                    if(resumePerGender==1){
                        gender = "男"
                    }else{
                        gender  = "女"
                    }
                    var resumesText = perName+"    |    "+gender+"|    22岁    |    1年工作经验    |    "+resumePerAddress;
                    var perNameText = ($(".resumesJump").children('div').eq(i).children(":last-child").children('div').eq(0).children('div').eq(2).children(":first").text(resumesText));
                    // console.log("渲染的数据简历个人"+);

                    // ==================判断简历的公开程度
                    var stm = "";
                    if(readStatus == null) {
                        stm = "对所有人公开";
                    }else if(readStatus == 0){
                        stm = "对纳贤网公开"
                    }else if(readStatus ==1){
                        stm = "完全保密";
                    }else {
                        stm = "请选择"
                    }
                    console.log(stm);
                    // =======================动态渲染简历公开程度
                    var resumeStatustext = ($(".resumesJump").children('div').eq(i).children(":last-child").children('div').eq(0).children('div').eq(0).children(":last-child").text(stm));
                    // =======================动态渲染简历更新时间
                    if(resumesTime!=null) {
                        var resumesTime1=    date2String(resumesTime);
                        var resumeTimetext = ($(".resumesJump").children('div').eq(i).children(":last-child").children('div').eq(0).children('div').eq(1).children(":last-child").text(resumesTime1));
                    }else{
                        var resumesCreateTime2 = date2String(resumesCreateTime);
                        var resumeTimetext = ($(".resumesJump").children('div').eq(i).children(":last-child").children('div').eq(0).children('div').eq(1).children(":last-child").text(resumesCreateTime2));
                    }
                    //==========================把简历id放在刷新按钮的value中
                    var resumesIdText = ($(".resumesJump").children('div').eq(i).children('div').eq(1).children('div').eq(1).children(":first").children(":first").val(resumesId));
                    layui.use('form', function() {
                        var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
                        form.render();
                    });
                    layui.use('form', function(){
                        var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功

                        form.on('select(aihao)',function(data){
                            console.log(data);
                        });

                        //但是，如果你的HTML是动态生成的，自动渲染就会失效
                        //因此你需要在相应的地方，执行下述方法来进行渲染
                        form.render('select');
                        form.render('checkbox');

                        //给表单赋值
                        form.val("gongkaibiaodan", { //gongkaibiaodan 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
                            "option": 0 // "name": "value"
                            ,"sex": "女"
                            ,"auth": 3
                            ,"check[write]": true
                            ,"open": false
                            ,"desc": "我爱layui"
                        });
//获取表单区域所有值
                        var data1 = form.val("formTest");
                    });
                    //刷新操作
                    var goods = document.getElementById("resumesJump");
                    goods.onclick = function (event) {
                        var node = event.target; // 获得事件触发者
                        if(node.nodeName="button") {
                            if (node.innerText == "刷新"  ) {
                                var resumsId = node.value;
                                console.log("按钮的值"+resumsId);
                                $.ajax( {
                                    url:"${pageContext.request.contextPath}/personCenter/iframeResumes",
                                    type:"post",
                                    data:{
                                        "resumesId":resumsId
                                    },
                                    dataType:"json",
                                    success:function (result3){
                                        var stemp = result3.data;
                                        if(stemp){
                                            alert("刷新成功")
                                        }
                                    }
                                });
                            }
                            if (node.innerText == "-" &&  node.nextElementSibling.innerHTML>1) {
                            }
                        }
                    }
                }
            }
        });


        $.ajax({
            url:"${pageContext.request.contextPath}/myApplication",
            type:"get",
            dataType:"JSON",
            success:function (result) {

                var data = result.data;
                var content= '';
                console.log(data+"dsgergrwegre");
                $.each(data,function (i,item) {
                    console.log(i);
                    console.log(item);
                    content+=' <div class="apox">';
                    content+='<div class="e">';
                    content+=' <div class="li l1">';
                    content+='  <a class="zhn" href="${pageContext.request.contextPath}/search/recruit/'+item.recruit.recId+ '/" target="_blank" >'+item.recruit.recName+'</a>';
                    content+='   <span class="xz" title="0.5-1万/月">'+item.recruit.recJobSalary+'</span>';
                    content+=' <br>';
                    content+=' <a class="gs" target="_blank" href="${pageContext.request.contextPath}/recruit/' + item.recruit.recId+'/" >'+item.company.companyName+'</a>';
                    content+='  <span class="dq" title="苏州">'+item.recruit.recJobAddress+'</span>';
                    content+='   </div>';
                    content+='  <div class="li l2">';
                    content+='   <div class="rq">';
                    content+='   <label>申请于</label><span>'+item.companyReceived.receiveTime+'</span>';
                    content+='  </div>';
                    content+='  </div>';
                    content+='  <div class="li l3">';
                    content+='  <div class="c_light_blue"><label>近两月申请：</label><span class="c_orange">7</span><label>人</label></div>';
                    content+=' </div>';
                    content+='  <div class="li l4">';
                    content+='    </div>';
                    content+='  </div>';
                    content+='  </div>';



                })
                $(".exmsg").append(content);


            }
        })
    }

</script>
<body onload="iframe()">

<jsp:include page="../head.jsp"></jsp:include>
<!-- 页面中间内容-->
<div class="content">
    <div class="exlt">
        <a track-type="trackIndexClick" event-type="28" href="${pageContext.request.contextPath}/resumeCenter/personCenter.jsp" class="on">
            <span>我的个人中心</span>
        </a>
        <a track-type="trackIndexClick" event-type="29" href="${pageContext.request.contextPath}/resumeCenter/resumeCenter.jsp" class="">
            <span>简历中心
            <em class="new"></em>
            </span>
        </a>

        <a track-type="trackIndexClick" event-type="31" href="${pageContext.request.contextPath}/resumeCenter/myCollection.jsp" class>
            <span>我的收藏</span>
        </a>
        <a track-type="trackIndexClick" event-type="32" href="${pageContext.request.contextPath}/resumeCenter/userSet.jsp" class>
            <span>我的申请</span>
        </a>
    </div>
    <div class="exrt">
        <div class="resume">
            <div class="layui-carousel" id="test3" lay-filter="test4">
                <div carousel-item="" id="resumesJump" class="resumesJump">
                    <div class="rview">
                        <div class="pre" style="display: none;"></div>
                        <div class="rli">
                            <img class="man" src="${pageContext.request.contextPath}/images/man.png" alt="头像" width="85" height="104">
                            <a class="a" track-type="trackButtonClick" event-type="1" href="${pageContext.request.contextPath}/resumeCenter/personCenter.jsp">设置</a>
                            <div class="rcon" style="margin-top: -36.5px;">
                                <div class="h1 e1"><a href="" title="我简历"></a><em class="gk">对纳贤公开</em></div>
                                <div class="e">
                                    <label>更新：</label>
                                    <span class="refreshdate" id="refreshdate_395874845">2019-09-16</span>
                                </div>
                                <div class="r1"><span title="刘宝鹤&nbsp;&nbsp;|&nbsp;&nbsp;男&nbsp;&nbsp;|&nbsp;&nbsp;22岁&nbsp;&nbsp;|&nbsp;&nbsp;2年工作经验&nbsp;&nbsp;|&nbsp;&nbsp;现居住佳木斯">刘宝鹤&nbsp;&nbsp;|&nbsp;&nbsp;男&nbsp;&nbsp;|&nbsp;&nbsp;22岁&nbsp;&nbsp;|&nbsp;&nbsp;2年工作经验&nbsp;&nbsp;|&nbsp;&nbsp;现居住佳木斯</span></div>
                            </div>
                            <div id="btnbox" class="btnbox">
                                <div class="site-demo-button" id="layerDemo1" style="margin-bottom: 0;">

                                    <button value="haha"  data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">刷新</button>
                                </div>
                                <a href=""><span class="p_but geige" track-type="trackButtonClick" event-type="3" onclick="">编辑</span></a>
                            </div>
                        </div>
                    </div>
                    <div class="rview">
                        <div class="pre" style="display: none;"></div>
                        <div class="rli">
                            <img class="man" src="${pageContext.request.contextPath}/images/man.png" alt="头像" width="85" height="104">
                            <a class="a" track-type="trackButtonClick" event-type="1" href="${pageContext.request.contextPath}/resumeCenter/personCenter.jsp">设置</a>
                            <div class="rcon" style="margin-top: -36.5px;">
                                <div class="h1 e1"><a href="javascript:void(0);" title="我的简历" onclick="edit(395874845,0,'//i.51job.com/resume')">我的简历</a><em class="gk">对纳贤公开</em></div>
                                <div class="e">
                                    <label>更新：</label>
                                    <span class="refreshdate" id="refreshdate_39587484">2019-09-16</span>
                                </div>
                                <div class="r1"><span title="刘宝鹤&nbsp;&nbsp;|&nbsp;&nbsp;男&nbsp;&nbsp;|&nbsp;&nbsp;22岁&nbsp;&nbsp;|&nbsp;&nbsp;2年工作经验&nbsp;&nbsp;|&nbsp;&nbsp;现居住佳木斯">刘宝鹤&nbsp;&nbsp;|&nbsp;&nbsp;男&nbsp;&nbsp;|&nbsp;&nbsp;22岁&nbsp;&nbsp;|&nbsp;&nbsp;2年工作经验&nbsp;&nbsp;|&nbsp;&nbsp;现居住佳木斯</span></div>

                            </div>
                            <div class="btnbox">
                                <div class="site-demo-button" id="layerDemo2" style="margin-bottom: 0;">
                                    <button value=""  data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">刷新</button>
                                </div>
                                <a href="${pageContext.request.contextPath}/personInfo/writeResume.jsp"> <span class="p_but geige" track-type="trackButtonClick" event-type="3" onclick="">编辑</span></a>
                            </div>
                        </div>
                    </div>
                    <div class="rview">
                        <div class="pre" style="display: none;"></div>
                        <div class="rli">
                            <img class="man" src="${pageContext.request.contextPath}/images/man.png" alt="头像" width="85" height="104">
                            <a class="a" track-type="trackButtonClick" event-type="1" href="${pageContext.request.contextPath}/resumeCenter/personCenter.jsp">设置</a>
                            <div class="rcon" style="margin-top: -36.5px;">
                                <div class="h1 e1"><a href="javascript:void(0);" title="我的简历" onclick="edit(395874845,0,'//i.51job.com/resume')">我简历</a><em class="gk">对纳贤公开</em></div>
                                <div class="e">
                                    <label>更新：</label>
                                    <span class="refreshdate" id="refreshdate_39587445">2019-09-16</span>
                                </div>
                                <div class="r1"><span title="刘宝鹤&nbsp;&nbsp;|&nbsp;&nbsp;男&nbsp;&nbsp;|&nbsp;&nbsp;22岁&nbsp;&nbsp;|&nbsp;&nbsp;2年工作经验&nbsp;&nbsp;|&nbsp;&nbsp;现居住佳木斯">刘宝鹤&nbsp;&nbsp;|&nbsp;&nbsp;男&nbsp;&nbsp;|&nbsp;&nbsp;22岁&nbsp;&nbsp;|&nbsp;&nbsp;2年工作经验&nbsp;&nbsp;|&nbsp;&nbsp;现居住佳木斯</span></div>

                            </div>
                            <div class="btnbox">
                                <div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
                                    <button value=""  data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">刷新</button>
                                </div>
                                <a href=""> <span class="p_but geige" track-type="trackButtonClick" event-type="3" onclick="">编辑</span></a>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

            <div class="rsee clearfix">
                <div class="rsl r1"><a track-type="trackButtonClick" event-type="4" href="resumeBrowsed.jsp">谁看过我 <span class="c_orange" id="whoviewmenum">13</span></a></div>
                <div class="rsl r2"><a track-type="trackButtonClick" event-type="5" href="${pageContext.request.contextPath}/resumeCenter/userSet.jsp">我的申请 <span class="c_orange">8</span></a></div>
                <div class="rsl r3"><a track-type="trackButtonClick" event-type="6" href="${pageContext.request.contextPath}/resumeCenter/myCollection.jsp">我的收藏 <span class="c_orange" id="my_collection_num">1</span></a></div>
            </div>
            <div class="rex"></div>
        </div>
        <!--申请与反馈-->
        <div class="ebox">
            <div class="e_tit">申请与反馈</div>
            <div class="exmsg" style="display:block">

            </div>
        </div>
    </div>
</div>
<!--底层导航-->
<div class="footer">
    <div class="bottom">
        <div class="bottom1">
            <li><strong>联系方式：1383838438</strong></li>
            <li>Email：NaXian.com（公司）</li>
            <li>13843843@qq.com（个人）</li>
        </div>
        <div class="bottom2">
            <ul>
                <li><strong>简介</strong></li>
                <li> 关于我们</li>
                <li> 服务声明</li>
                <li>媒体报道</li>
                <li> Investor Relations</li>
            </ul>
        </div>
        <div class="bottom3">
            <ul>
                <li><strong>合作</strong></li>
                <li> 加入我们</li>
                <li> 联系我们</li>
                <li>友情链接</li>
            </ul>

        </div>
        <div class="bottom4">

            <ul>
                <li><strong>帮助</strong></li>
                <li> 帮助中心</li>
                <li> 常见问题</li>
                <li>新手引导</li>
            </ul>
        </div>
        <div class="bottom5">

            <ul>
                <li><strong>导航</strong></li>
                <li> 网站地图</li>
                <li> 职位搜索</li>
                <li>简历中心</li>
                <li> 企业名录</li>
            </ul>
        </div>
        <div class="bottom6">
            <img src="${pageContext.request.contextPath}/images/NaXian.png">
            <p>服务号</p>
        </div>
    </div>
</div>
<script src="${pageContext.request.contextPath}/js/personalCenter.js" charset="utf-8"></script>

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use('layer', function(){ //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句

        //触发事件
        var active = {
            setTop: function(){
                var that = this;
                //多窗口模式，层叠置顶
                layer.open({
                    type: 2 //此处以iframe举例
                    ,title: '当你选择该窗体时，即会在最顶端'
                    ,area: ['390px', '260px']
                    ,shade: 0
                    ,maxmin: true
                    ,offset: [ //为了演示，随机坐标
                        Math.random()*($(window).height()-300)
                        ,Math.random()*($(window).width()-390)
                    ]
                    ,content: '//layer.layui.com/test/settop.jsp'
                    ,btn: ['继续弹出', '全部关闭'] //只是为了演示
                    ,yes: function(){
                        $(that).click();
                    }
                    ,btn2: function(){
                        layer.closeAll();
                    }

                    ,zIndex: layer.zIndex //重点1
                    ,success: function(layero){
                        layer.setTop(layero); //重点2
                    }
                });
            }
            ,confirmTrans: function(){
                //配置一个透明的询问框
                layer.msg('大部分参数都是可以公用的<br>合理搭配，展示不一样的风格', {
                    time: 20000, //20s后自动关闭
                    btn: ['明白了', '知道了', '哦']
                });
            }
            ,notice: function(){
                //示范一个公告层
                layer.open({
                    type: 1
                    ,title: false //不显示标题栏
                    ,closeBtn: false
                    ,area: '300px;'
                    ,shade: 0.8
                    ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
                    ,btn: ['火速围观', '残忍拒绝']
                    ,btnAlign: 'c'
                    ,moveType: 1 //拖拽模式，0或者1
                    ,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">你知道吗？亲！<br>layer ≠ layui<br><br>layer只是作为Layui的一个弹层模块，由于其用户基数较大，所以常常会有人以为layui是layerui<br><br>layer虽然已被 Layui 收编为内置的弹层模块，但仍然会作为一个独立组件全力维护、升级。<br><br>我们此后的征途是星辰大海 ^_^</div>'
                    ,success: function(layero){
                        var btn = layero.find('.layui-layer-btn');
                        btn.find('.layui-layer-btn0').attr({
                            href: 'http://www.layui.com/'
                            ,target: '_blank'
                        });
                    }
                });
            }
            ,offset: function(othis){
                var type = othis.data('type')
                    ,text = othis.text();

                layer.open({
                    type: 1
                    ,title: '提示'
                    ,offset: type //具体配置参考：http://www.layui.com/doc/modules/layer.jsp#offset
                    ,id: 'layerDemo'+type //防止重复弹出
                    ,content: '<div style="padding: 40px 200px;">'+ text +'</div>'
                    ,time: 3000 //自动关闭时间
                    ,btnAlign: 'c' //按钮居中
                    ,content: '<div style=" width: 300px; text-align: center; padding: 30px; line-height: 22px; background-color: #fff; color: #000; font-weight: 300;"><span style=" line-height: 22px;  color: #000; font-weight: 300;">刷新成功</span></div>'
                    ,shade: 0 //不显示遮罩
                    ,yes: function(){
                        layer.closeAll();
                    }
                });
            }
        };

        $('#layerDemo .layui-btn').on('click', function(){
            var othis = $(this), method = othis.data('method');
            active[method] ? active[method].call(this, othis) : '';
        });

    });
</script>
<script src="${pageContext.request.contextPath}/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['carousel', 'form'], function(){
        var carousel = layui.carousel
            ,form = layui.form;

        //常规轮播
        carousel.render({
            elem: '#test1'
            ,arrow: 'always'
        });

        //改变下时间间隔、动画类型、高度
        carousel.render({
            elem: '#test2'
            ,interval: 1800
            ,anim: 'fade'
            ,height: '120px'
        });

        //设定各种参数
        var ins3 = carousel.render({
            elem: '#test3'
        });
        //图片轮播
        carousel.render({
            elem: '#test10'
            ,width: '778px'
            ,height: '440px'
            ,interval: 5000
        });

        //事件
        carousel.on('change(test4)', function(res){
            console.log(res)
        });

        var $ = layui.$, active = {
            set: function(othis){
                var THIS = 'layui-bg-normal'
                    ,key = othis.data('key')
                    ,options = {};

                othis.css('background-color', '#5FB878').siblings().removeAttr('style');
                options[key] = othis.data('value');
                ins3.reload(options);
            }
        };

        //监听开关
        form.on('switch(autoplay)', function(){
            ins3.reload({
                autoplay: this.checked
            });
        });

        $('.demoSet').on('keyup', function(){
            var value = this.value
                ,options = {};
            if(!/^\d+$/.test(value)) return;

            options[this.name] = value;
            ins3.reload(options);
        });

        //其它示例
        $('.demoTest .layui-btn').on('click', function(){
            var othis = $(this), type = othis.data('type');
            active[type] ? active[type].call(this, othis) : '';
        });
    });


</script>


</body>
</html>




